import request from '@/utils/request'

// 供应商分页查询
export function getSuppliers(params) {
  return request({
    url: '/suppliers',
    method: 'get',
    params
  })
}

// 根据ID获取供应商详情（包含文件信息）
export function getSupplierById(id) {
  return request({
    url: `/suppliers/${id}`,
    method: 'get'
  })
}

// 创建供应商
export function createSupplier(data) {
  return request({
    url: '/suppliers',
    method: 'post',
    data
  })
}

// 更新供应商
export function updateSupplier(id, data) {
  return request({
    url: `/suppliers/${id}`,
    method: 'put',
    data
  })
}

// 删除供应商
export function deleteSupplier(id) {
  return request({
    url: `/suppliers/${id}`,
    method: 'delete'
  })
}

